package com.szosen.util;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.EditText;

public class DateOnlyEditText extends EditText {
	private Context context;

	public DateOnlyEditText(Context context) {
		super(context);
		this.context = context;
	}

	public DateOnlyEditText(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		this.context = context;
	}

	public DateOnlyEditText(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.context = context;

	}

	private void showDateDailog() {
		new DateSelectDialog(context, new DateSelectDialog.DialogTask() {
			@Override
			public void process(String date) {
				setText(date);
			}
		}).show();
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		showDateDailog();
		return false;

	}
}
